package fun.wlfj.j2t.main;

import java.io.File;
import java.io.FileNotFoundException;

import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.CompilationUnit;

import fun.wlfj.j2t.Visitor.TestMethodFinder;
import fun.wlfj.j2t.container.ClazzContainer;
import fun.wlfj.j2t.container.MapTable;
import fun.wlfj.j2t.converter.IR2AST;
import fun.wlfj.j2t.model.Element;

public class Main {
	
	public static final String FILE_PATH = "resources/TestHello.java";

	public static void main(String[] args) throws FileNotFoundException {
		CompilationUnit cu = StaticJavaParser.parse(new File(FILE_PATH));
		TestMethodFinder tmf = new TestMethodFinder();
		
		
		tmf.visit(cu, null);
		System.out.println("Finishned");
		// 现在我们检查结果
		ClazzContainer container = ClazzContainer.getInstance();
		for(String name : container.keySet()) {
			System.out.println(container.get(name).getRepr());
		}
		
		// 现在我们要根据ClazzContainer的内容创建AST了
		IR2AST.job(container).forEach(c -> System.out.println(c));
		
	}

}
